package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaReservationItemMapper;
import com.yiyahui.project.erp.domain.YiyaReservationItem;
import com.yiyahui.project.erp.service.IYiyaReservationItemService;

/**
 * 预约看诊项目Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-14
 */
@Service
public class YiyaReservationItemServiceImpl implements IYiyaReservationItemService 
{
    @Autowired
    private YiyaReservationItemMapper yiyaReservationItemMapper;

    /**
     * 查询预约看诊项目
     * 
     * @param id 预约看诊项目ID
     * @return 预约看诊项目
     */
    @Override
    public YiyaReservationItem selectYiyaReservationItemById(Long id)
    {
        return yiyaReservationItemMapper.selectYiyaReservationItemById(id);
    }

    /**
     * 查询预约看诊项目列表
     * 
     * @param yiyaReservationItem 预约看诊项目
     * @return 预约看诊项目
     */
    @Override
    public List<YiyaReservationItem> selectYiyaReservationItemList(YiyaReservationItem yiyaReservationItem)
    {
        return yiyaReservationItemMapper.selectYiyaReservationItemList(yiyaReservationItem);
    }

    /**
     * 新增预约看诊项目
     * 
     * @param yiyaReservationItem 预约看诊项目
     * @return 结果
     */
    @Override
    public int insertYiyaReservationItem(YiyaReservationItem yiyaReservationItem)
    {
        yiyaReservationItem.setCreateTime(DateUtils.getNowDate());
        return yiyaReservationItemMapper.insertYiyaReservationItem(yiyaReservationItem);
    }

    /**
     * 修改预约看诊项目
     * 
     * @param yiyaReservationItem 预约看诊项目
     * @return 结果
     */
    @Override
    public int updateYiyaReservationItem(YiyaReservationItem yiyaReservationItem)
    {
        yiyaReservationItem.setUpdateTime(DateUtils.getNowDate());
        return yiyaReservationItemMapper.updateYiyaReservationItem(yiyaReservationItem);
    }

    /**
     * 批量删除预约看诊项目
     * 
     * @param ids 需要删除的预约看诊项目ID
     * @return 结果
     */
    @Override
    public int deleteYiyaReservationItemByIds(Long[] ids)
    {
        return yiyaReservationItemMapper.deleteYiyaReservationItemByIds(ids);
    }

    /**
     * 删除预约看诊项目信息
     * 
     * @param id 预约看诊项目ID
     * @return 结果
     */
    @Override
    public int deleteYiyaReservationItemById(Long id)
    {
        return yiyaReservationItemMapper.deleteYiyaReservationItemById(id);
    }
}
